home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 022a / dta16.zip / DTA.DOC < prev    next >
Text File  |  1992-01-25  |  15KB  |  361 lines

  1. DTA (Dave's .TGA Animation Program)
  2. Copyright (c) 1991, by David K. Mason
  3.  
  4. Release 1.6 (01/25/91)
  5.  
  6. DTA is a command-line utility designed to post-process TGA
  7. files created by the DKB/Starlite/PV/POV and POLYRAY ray-tracers,
  8. .IMG files from the Vivid ray-tracer, or .GIF files
  9. (87a variety only).
  10.  
  11. DTA can:
  12.  
  13.  o Create a single optimal 256-color palette from a series of
  14.    truecolor pictures, and then create an Autodesk Animator .FLI
  15.    file out of them.
  16.  o Or, just save the palette as a .COL file (readable by either
  17.    Autodesk Animator or TGAFLI).
  18.  o Or, save the palette as a .MAP file (readable by PICLAB and
  19.    FRACTINT).
  20.  o Or, read in a palette file in either .COL or .MAP format
  21.    and animate a bunch of pictures using that palette.
  22.  o Or, animate a bunch of pictures using grayscale.
  23.  o Or, convert pictures to .GIF files.
  24.  
  25. Syntax:
  26.  
  27.  Type DTA with no parameters to see a listing of parameters
  28.  and stuff.
  29.  
  30. NOTE:
  31.  There was some other stuff I'd planned to put into this
  32.  release of DTA, like color-mapped TGA support, compressed
  33.  TGA output, etc.  But I've gotten distracted by another
  34.  project, so I'm going to let DTA sit for a while.
  35.  Keep the suggestions and bug reports comin', though
  36.  'cause I will get back to it eventually.
  37.  
  38. What's new:
  39.  
  40.  Rel 1.6 (01/25/91)
  41.   o Can write uncompressed Targa-16 files (use the /B16 switch).
  42.   o Can read compressed and uncompressed Targa-16 files (like
  43.     those you can produce with POLYRAY).
  44.   o Added /M option, which causes the palette tree-reduction
  45.     routine to prune the most popular branches instead of
  46.     least popular.  The resulting palette should be biased
  47.     a bit more toward detail in a picture instead of smoothly
  48.     shaded areas.
  49.   o Added /L option, which allows you to set the initial
  50.     (pre-reduction, that is) color resolution for one or
  51.     more of the color components (r,g,b) to something other
  52.     than the default 6 bits.  It doesn't make sense to set
  53.     it higher than 6 bits, since that's the most VGA can display.
  54.     But you could, for example, tell DTA to use fewer bits for
  55.     green and blue so that the reds get more representation,
  56.     like so:
  57.      dta *.tga /lb2 /lg3
  58.     (that sets the blue resolution to 2 bits and the green
  59.     resolution to 3 bits).
  60.   o When averaging pictures, DTA used to use an equal percentage
  61.     of each of the original pictures.  That's still the default,
  62.     but with the /E option, you can change this.  /E lets you
  63.     specify two numbers: (a) the amount of weight to give the
  64.     first picture, and (b) how much to increment that weight
  65.     for each successive picture.  So, assuming you start with
  66.     three TGA files, if you use this command:
  67.      dta *.tga /a5 /e2;1 /fg
  68.     the first frame will get a weight of 2, the second will get
  69.     3, and the third will get 4.  Which means the resulting
  70.     GIF file will be made up 22% from the first picture, 33%
  71.     from the second, 44% from the third.
  72.     This can be used with /t (trail) as well as /a (average).
  73.     The increment number can be negative... if you want
  74.     the first picture to stand out more than the others.
  75.     The default for the initial weight is 1.  The default
  76.     for the increment is 0.  If you use /e without specifying
  77.     an increment, then the increment is set to 1.
  78.     If you don't specify either number, then both numbers are
  79.     set to 1.
  80.   o Fixed a bug in averaging GIF files.
  81.   o When creating a new TGA file, DTA forgot to use the resolution
  82.     of the input file like it does with GIF files.  Fixed.
  83.   o Can now ignore comments in TGA files properly.
  84.   o When creating GIF files, DTA now saves at the same
  85.     time it performs the mapping step, instead of saving to
  86.     a buffer and saving it at the end.
  87.     For pictures that would require virtual memory (bigger
  88.     than 320x200), this'll save some time.
  89.   o Added 640x400 resolution for low-end SVGA.
  90.  Rel 1.5f (12/13/91)
  91.   o DTA can now read IMG files created by the Stephen Coy's
  92.     Vivid raytracer.
  93.   o Speeded up some input functions that were slowed down
  94.     because of some recently added features.
  95.   o Another probably unsuccessful attempt to fix the same bug
  96.     that 1.5d was supposed to fix.
  97.   o Fixed a bug in dithering (sometimes DTA wouldn't dither
  98.     the whole picture).
  99.   o DTA wasn't deleting a temporary file that it sometimes
  100.     creates.  Now it does.
  101.  Rel 1.5e (11/24/91)
  102.   o DTA can now read GIF files as well as TGAs.  GIF87 only,
  103.     no interlacing allowed.
  104.   o Added a /V (verbose) command line option.  If you
  105.     specify this, DTA will tell you exactly how many
  106.     bytes each frame in an animation take up.
  107.   o Added the /W option, which forces DTA to use the
  108.     SVGA-type compression method, even if generating
  109.     a 320x200 .FLI.
  110.   o By the way the fix in 1.5d didn't help.  However, the
  111.     problem is pretty rare.  Maybe next time.
  112.  Rel 1.5d (11/18/91)
  113.   o Hopefully fixed a bug that caused problems with Trilobyte's
  114.     PLAY program.
  115.  Rel 1.5c (11/11/91)
  116.   o Attempting to support 800x600, 1024x768, and 1280x1024
  117.     SVGA resolutions.  Note: This is completely untested.
  118.     I haven't the foggiest idea if it works or not.
  119.  Rel 1.5b (11/09/91)
  120.   o Added "expansion" feature, which inserts averaged frames
  121.     between regular frames.
  122.   o Fixed some bugs in some weird combinations of 3d, "pingpong",
  123.     and "trail".
  124.  Rel 1.5 (11/05/91)
  125.   o Ordered dithering
  126.   o VGA "mode x" .FLI resolutions
  127.   o fixed a bug in 320x200 delta encoding
  128.     which would sometimes cause animations to crash
  129.   o "averaging" and "trailing" (where individual frames are
  130.     created by averaging the colors across multiple input
  131.     files).  The difference between "averaging" and "trailing" is:
  132.      If you run an "average" of 2 on 10 .TGAs, frame 1 will be
  133.     an average of files 1 and 2, frame 2 an average of files 3
  134.     and 4, and so on.
  135.      If you do a "trail" of 2 on 10 .TGAs,
  136.     then frame 1 will be an average of 1 and 2, frame 2 an average
  137.     of files 2 and 3, frame 3 an average of files 3 and 4, and
  138.     so on.
  139.   o Red/blue-type 3d
  140.   o TGA output (pretty useless unless you're also averaging
  141.     input files or creating 3d images).  DTA does not compress
  142.     TGAs just yet.
  143.  Rel 1.4 TEST 2 (10/12/91)
  144.   o DTA can now read compressed .TGAs.
  145.   o DTA can new create .GIFs or .PCXs.
  146.   o Before 1.4, DTA would give up on compressing a frame if the
  147.     compressed version required more than about 64K to store.
  148.     This was fine for 320x200 animations, where an uncompressed
  149.     frame only requires 64K anyway, but it left something to
  150.     be desired for 640x480 animations, where an uncompressed
  151.     frame takes up about 300K.
  152.     Now, 640x480 frames will be compressed unless the compressed
  153.     version takes up more than about 300K.
  154.  Rel 1.3c (09/14/31) (second bug fix)
  155.   o .MAP files were missing carriage returns between
  156.     lines.
  157.  Rel 1.3b (09/13/31) (bugfix release)
  158.   o Fixed bugs from the disastrous Rel. 1.3
  159.     (including 640x480 .FLIs)
  160.   o Big speed increase in palette creation
  161.  Rel 1.3 (09/03/91)
  162.   o 640x480 .FLIs
  163.   o Better .FLI compression.
  164.   o In pre-1.3, the animation was stored in a temporary file,
  165.     then at the end a new file was created with the .FLI header,
  166.     and then the temporary file was copied onto the end of that.
  167.     Now, only one file is used to store the animation, and the
  168.     header gets modified at the end of the process.
  169.   o Frame #1 is now stored in a temporary file so that it doesn't
  170.     need to be recreated for the "ring frame".
  171.   o Added /G32 option for creating 32-level grayscale animations
  172.     for laptops.
  173.   o Fixed some bugs.
  174.  Rel 1.2 (08/06/91)
  175.   o Added support for exit codes returned by LHA 2.13...
  176.     If LHA returns a non-zero exit code, DTA will abort.
  177.   o If you hit the escape key while DTA is running,
  178.     DTA will abort as soon as it's done processing
  179.     an input file.
  180.   o Changed the way input files are sorted... see
  181.     Examples, below.
  182.   o Added /p (pingpong) option.  (makes animation go in
  183.     0-1-2-3-4-3-2-1-0 order instead of 0-1-2-3-4-0).
  184.   o Added support for lists of files to process.
  185.     Tell DTA that a file is a list by preceding the filename
  186.     by an "@" character.  A list file may contain
  187.     the names of .TGA files or .LZH files.  You can't put
  188.     the name of another list file in a list file.
  189.   o Will now clip .TGA files with a resolution greater than
  190.     320x200 instead of choking on them.
  191.   o Added /O (sort order) option.  When DTA has to sort filenames,
  192.     like when you use a wildcards or when you just give the name
  193.     of an .LZH file, "/O+" (the default) will tell DTA to sort
  194.     in ascending order, "/O-" in descending order.
  195.     This option is positional... it will only affect files
  196.     specified AFTER the option on the DTA command line.
  197.     You can use this more than once on a DTA command line.
  198.  Rel 1.1 (07/15/91)
  199.   o Can now extract .TGA files from inside of .LZH files.
  200.     (by shelling to LHA.EXE)  Takes longer, but can save plenty
  201.     of disk space.
  202.   o Added /s (to specify playing speed).
  203.   o Doesn't choke on truncated .TGA files any more.
  204.   o Rewrote some I/O routines so scanning palettes is quicker.
  205.  
  206. Examples:
  207.  
  208.   C>dta rocket*.tga /fcrocket
  209.     make a palette for all tga files starting with "rocket" and put
  210.     the palette in an Animator palette file called "ROCKET.COL".
  211.  
  212.   C>dta pic1 pic2 pic3 /fmxxx
  213.     make a palette for targa files "PIC1.TGA", "PIC2.TGA", and "PIC3.TGA", and
  214.     save the palette into a PICLAB palette file called "ROCKET.MAP".
  215.  
  216.   C>dta rocket* /frocket /df
  217.     turn all tga files beginning with "rocket" into an animation file called
  218.     "ROCKET.FLI", and dither the frames.
  219.  
  220.   C>dta rocket* /g /do2 /p
  221.     turn all tga files beginning with "rocket" into a grayscale
  222.     animation.  Dither it (using ordered dither strength 2).
  223.     Ping-pong it.
  224.  
  225.   C>dta garbage
  226.     make an animation for one targa file called "GARBAGE.TGA", and save it
  227.     as "ANIM.FLI".  Don't dither.
  228.  
  229.   C>dta @wing2.lst /s10 /fwing2.fli
  230.     make an animation from the targa files listed in a text file
  231.     called "wing2.lst".  Make the speed "10", and put the output
  232.     in a file called "wing2.fli".
  233.  
  234.   C>dta bbb*.tga aaa*.tga /upal1.col /upal2.map /ffred
  235.     create an animation using all tga files whose name begins with
  236.     "BBB", and "AAA".  Note that unlike the previous version of DTA,
  237.     The "BBB" files WILL appear in the animation before the "AAA"
  238.     files.  The "BBB" files will be sorted alphabetically,
  239.     and so will the "AAA" files, but separately.
  240.     For the palette of the animation, read in an Animator palette file
  241.     called "PAL1.COL", and merge it with a Piclab palette file called
  242.     "PAL2.MAP".  Put the animation in a file called "FRED.FLI".
  243.  
  244.   C>dta /o- xxx*.tga /o+ zzz.lzh /g /s5 /p
  245.     Make a .FLI with all .TGAs whose filename begins with
  246.     XXX (sorting the filenames backwards), then all .TGAs
  247.     residing in ZZZ.LZH (sorting the filenames forwards).
  248.     The .FLI should be in grayscale, at speed 5.
  249.     And pingpong the whole thing.
  250.  
  251.   C>dta *.tga /gif
  252.     Make .GIFs from all .TGAs in the current directory.
  253.  
  254.   C>dta sombrero /fp /d /g
  255.     Make a dithered grayscale .PCX from a file called
  256.     SOMBRERO.TGA
  257.  
  258.   C>dta left*.tga rght*.tga /3d
  259.     Make a red/blue 3d .FLI file, using the .TGA files beginning
  260.     with "left" as the red component, and the ones beginning with
  261.     "rght" as the blue component.  For this to work right, there
  262.     must be an equal number of "left" and "rght" .TGAs.
  263.  
  264.   C>dta xxx* /ftyy /aa
  265.     Average all .TGAs beginning with the string "xxx", and create
  266.     a new file called "yy.tga".  (Note: averaging will work with
  267.     up to 10 files, but no more.)
  268.  
  269.   C>dta xxx*.tga /t3 /do3 /ffzzz
  270.     Create a file called zzz.fli.  Assuming there are 5 .TGA files
  271.     beginning with the string "xxx", frame 1 of the animation will
  272.     be an average of files 1,2, and 3; frame 2 will be an average
  273.     of files 2,3, and 4; ... frame 5 will be an average of
  274.     files 5,1, and 2.
  275.  
  276.   C>dta xxx*.tga /x3
  277.     Create a file called anim.fli. Assuming again that there are
  278.     5 .TGA files beginning with the string "xxx", it'll be a
  279.     15-frame animation where frame 1 is derived from the first
  280.     .TGA file, frame 2 will be be a be a 67%/33% mix of files
  281.     1 and 2, frame 3 a 33%/67% mix of the same files, frame 4
  282.     just file 2, and so on.
  283.  
  284.   C>dta *.gif
  285.     Creates a file called anim.fli from a bunch of .GIF files.
  286.  
  287. Speed:
  288.  
  289.   DTA is fastest when you use grayscale instead of a palette.
  290.   even if you dither.
  291.  
  292.   If you let DTA generate its own palette, DTA is still
  293.   relatively speedy.  It gets (lots) slower if you dither.
  294.  
  295.   If you create an animation from .TGA files stored in an .LZH
  296.   file, then DTA is REAL slow.
  297.  
  298.   If you're creating a 640x480 .FLI, then DTA requires about 614K
  299.   of memory just to store the pictures that it's comparing.
  300.   Since PCs just don't have that kind of memory lying around,
  301.   DTA will put it in EMS (expanded memory) if you have it, or
  302.   virtual memory (paging to disk) if you don't.  EMS is LOTS
  303.   faster than virtual memory.
  304.  
  305.   If you average multiple files, that's going to slow things down.
  306.  
  307. Credits:
  308.  
  309.   To create palettes and select colors from palettes, this
  310.   program uses an algorithm that I found in an article called "A
  311.   Simple Method for Color Quantization:  Octree Quantization," by
  312.   Michael Gervautz and Werner Purgathofer, which can be found in
  313.   a book called "Graphics Gems," edited by Andrew S. Glassner.  I
  314.   recommend this book highly.
  315.  
  316.   The .FLI file format was explained in a document called
  317.   FLIDOC.TXT from Jim Kent's FLILIB.  I wasn't able to use this C
  318.   library in DTA, since I do my coding in Turbo Pascal, but the
  319.   document contained all the info I needed.  (Jim Kent is also
  320.   the guy who, with Tom Hudson, wrote TGAFLI, and who developed
  321.   Animator and Animator Pro.)
  322.  
  323.   More thanks to Jim Kent for his info about 640x480 .FLIs on
  324.   BIX.
  325.  
  326.   The ram/ems/virtual memory system in DTA is a modified
  327.   version of the large array object (OPLARRAY) from TurboPower
  328.   Software's object library for Turbo Pascal, Object Professional.
  329.   (OPRO is a MUST for TP programmers, and I hear a C++ version
  330.   has been or will soon be released.)
  331.  
  332.   Thanks to Dan Farmer, Alexander Enzmann, Jeff Bowermaster,
  333.   and others for their excellent suggestions.
  334.  
  335.   Thanks to the Cafe Algiers in Harvard Square for being such
  336.   a cool place to swill arabic coffee and discuss ray-tracing
  337.   and animation.
  338.  
  339. Money matters:
  340.  
  341.   If you think this program is worth it, send me some cash or
  342.   some beer or something.  If not, I'll survive.
  343.  
  344. Disclaimer:
  345.  
  346.   If you use DTA, you do so at your own risk.  I won't be held
  347.   responsible if it screws anything up.
  348.  
  349. Support:
  350.  
  351.   If you've got any requests/bug reports/suggestions, send a message
  352.   to:
  353.     "David Mason" on the "You Can Call Me Ray" BBS, (708) 358-5611
  354.     and on "Channel 1" BBS, (617) 354-8873
  355.  
  356.   You'll probably get some kind of a response.
  357.  
  358. -- David K. Mason
  359.    P.O. Box 181015
  360.    Boston, MA 02118
  361.